#include <iostream>
#include <algorithm>
#include <iomanip>
using namespace std;
class MooncakeType{
private:
    double capacity;
    double price;
    double perton;
public:
    MooncakeType(){
    }
    void setPrice(double p){
	price=p;
    }
    void setcapacity(double c){
	capacity=c;
    }
    void setperton(){
	perton=price/capacity;
    }
    double getperton(){
	return perton;
    }
    double getcapacity(){
	return capacity;
    }
    double getprice(){
	return price;
    }
};
class factory{
private:
    MooncakeType Cake[1050];
    int typenum;
    double buynum;//capacity!
    double cost;
public:
    static bool cmp(MooncakeType c1,MooncakeType c2){
	if(c1.getperton()<c2.getperton()){
	    return false;
	}else{
	    return true;
	}
    }
    factory(int _typenum,double _buynum){
	typenum=_typenum;
	buynum=_buynum;
	double n;
	double p;
	for(int i=0;i<_typenum;i++){
	    cin>>n;
	    Cake[i].setcapacity(n);
	}
	for(int i=0;i<_typenum;i++){
	    cin>>p;
	    Cake[i].setPrice(p);
	    Cake[i].setperton();
	}
	sort(Cake,Cake+_typenum,cmp);
	cost=0;
    }
    void buy();
};
void factory::buy(){
    int i=0;
    while(1){
	if(buynum<Cake[i].getcapacity()){
	    cost=cost+buynum*Cake[i].getperton();
	    cout<<fixed<<setprecision(2)<<cost<<endl;
	    break;
	}
	else{
	    buynum-=Cake[i].getcapacity();
	    cost=cost+Cake[i].getprice();
	    i++;
	}
    }
}
int main(){
    int n1;
    double n2;
    cin>>n1>>n2;
    factory F(n1,n2);
    F.buy();
}
